﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _06._02.CalculatePi
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Please enter a number for N");
            int N = int.Parse(Console.ReadLine());

            double result = 0;

            for (int i = 1; i <= N; i++)
            {
                double first = Math.Pow(-1, i + 1);
                double second = 1 / ((double)2 * i - 1);

                double inlineResult = first * second;
                result += inlineResult;
            }

            Console.WriteLine(result);
        }
    }
}
